﻿<?php

	include("../inc/joomlaInt_admin.php");
	include("../inc/inc_spiel.php");
	include("../inc/inc_configuration.php");

if ($jUser==0)
{
	echo "Bitte zuerst einloggen!";
}
else
{
	$q="SELECT gid FROM $tbl_users WHERE id=$jUser";
					$qe=mysql_query($q);
					$qeo=mysql_fetch_object($qe);
					
					$gid=$qeo->gid;
					
					if ($gid!=$admingroup)
					{
						echo "Du bist kein Admin!";
						break;
					}
					
	$matchday=$_POST["matchday"];
	$homeT=$_POST["homeTeam"];
	$guestT=$_POST["guestTeam"];
	$stage=$_POST["stage"];
	$liga=$_POST["liga"];
	$free=$_POST["free"];
	
	if ($stage==1)
	{
		$stage=0;
	}
	$test=spiel_anlegen($liga,$homeT,$guestT,$matchday,$stage,'"MANUELL ANGELEGT"',$free);

	echo 'Sie werden weitergeleitet... <meta http-equiv="refresh" content="0; URL=ligaspiele.php?liga=',$liga,'">   ';	
}	
	
?>